package com.mazaiting.blog.dao

import com.mazaiting.blog.domain.User
import org.junit.Test

import org.junit.runner.RunWith
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import javax.annotation.Resource


@RunWith(SpringRunner::class)
@EnableAutoConfiguration
@SpringBootTest
class UserDaoTest {

    @Resource
    private lateinit var userDao: UserDao


    @Test
    fun selectUserByName() {
        val user = userDao.selectUserByName("linghaoyu")
        println(user)
    }

    @Test
    fun addUser() {
        val user = User("linghaoyu", "linghaoyu")
        val id = userDao.addUser(user)
        println(id)
    }

}
